package com.hais1992.oneday.activity;

import java.util.HashMap;
import java.util.Map;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.hais1992.oneday.R;
import com.hais1992.oneday.common.Config;
import com.hais1992.oneday.tools.GetHttpData;
import com.hais1992.oneday.tools.GetHttpData.GetCallback;

/**
 * 软件启动界面
 * @author Hello_海生
 * @date 2014年5月26日
 */
public class StartActivity extends Activity{
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_start);
		
		Map<String, String> map = new HashMap<String, String>();
		map.put("start", "0");
		map.put("count", Config.PAGE_NUNBER);
		map.put("key", Config.SERVER_KEY);
		
		new GetHttpData(Config.SERVER_URL+Config.GET_LIST_URL, "POST", map, new GetCallback() {
			@Override
			public void onSuccess(String result) {
				Intent i = new Intent(StartActivity.this, MainActivity.class);
				i.putExtra("json", result);
				StartActivity.this.startActivity(i);
				StartActivity.this.finish();
			}
		});
		
	}
}
